﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace cmdeditor
{
    public partial class NewCha : Form
    {
        EditorMain Main;

        public NewCha()
        {
            InitializeComponent();
        }

        public NewCha(EditorMain eMain)
        {
            InitializeComponent();
            Main = eMain;
        }

        private void ShowMain()
        {
            Main.Enabled = true;
            Main.Focus();
        }

        private void buttonNewChaOk_Click(object sender, EventArgs e)
        {
            if (textChaName.Text.Length > 0)
            {
                Main.TreeAddNewCha(textChaName.Text);
                this.Close();
                ShowMain();
            }
            else
            {
                MessageBox.Show("请填入角色名字");
            }
        }

        private void buttonNewChaChanel_Click(object sender, EventArgs e)
        {
            this.Close();
            ShowMain();
        }
    }
}
